home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / intrfc70.zip / TPU9.DOC < prev    next >
Text File  |  1991-06-12  |  4KB  |  99 lines

  1. This is an outline of the structure of the Turbo Pascal 6.0 and Turbo
  2. Pascal for Windows 1.0 TPU file format.  Both use the same format of TPU
  3. file, with signature TPU9.
  4.  
  5. There are five sections; the first one has ten subsections.  Each
  6. section is limited to 64K in size.
  7.  
  8. I. SYMBOL SECTION
  9.  
  10. This section contains all the symbolic information, and has several
  11. subsections.
  12.  
  13. The size is given in header.symsize.  Actual size in file is rounded up
  14. to next even paragraph, as are all the sections.
  15.  
  16. A. Header subsection (/H turns display on)
  17.  
  18. Contains sizes, pointers, flags, and signature TPU9.  Structure given in
  19. HEAD.PAS. About $40 bytes, but it's not clear where it ends - the last
  20. part is always zeroed.
  21.  
  22. B. Object subsection (/N turns display off, or /I turns full display on)
  23.  
  24. An unfortunate choice of a name:  this section contains all the symbolic
  25. information, not just for Objects.  It contains one or two hash tables
  26. to get access to the various objects:  the interfaced objects are
  27. available from the one at ofs_hashtable, all debuggable ones are
  28. available from the one at ofs_full_hash.  There are also other smaller
  29. hash tables:  members of records, locals to functions/procedures, etc.
  30. HASH.PAS decodes the hash table.
  31.  
  32. There are basically two types of records:  obj_rec's and type_def_rec's.
  33. Obj_rec's give the name and "type", and are followed by specialized
  34. information describing the object.  Type_def_rec's give constructions
  35. for type definitions.  Both are given in NAMELIST.PAS and NAMETYPE.PAS,
  36. though the type_def_rec's should be handled by their own unit.
  37.  
  38. C. Entry point subsection (/E turns display on)
  39.  
  40. This is an array of fixed length records, one per
  41. function/procedure/method in the unit.  It gives the code block of the
  42. routine, and the entry point within that code block.  The first entry is
  43. for the initialization section of the unit.
  44.  
  45. D. Code block subsection (/D turns display on)
  46.  
  47. This is an array of fixed length records, one per block of code
  48. (usually, one per routine, but .OBJ files get just one block).
  49.  
  50. E. Const block subsection (/C turns display on)
  51.  
  52. Another array of fixed length records, one per block of initialized
  53. data. (This will be a typed Const declaration, or the VMT of an object.
  54.  
  55. F. Var block subsection (/V turns display on)
  56.  
  57. The same sort of thing for uninitialized static data.
  58.  
  59. G. Window DLL subsection (/W turns display on)
  60.  
  61. This section never appears in TP6 files, only in TPW.  It gives a table
  62. of external names which TPW for links to Dynamic Link Libraries.
  63.  
  64. H. Unit list subsection (/U turns display on)
  65.  
  66. All units on which this one depends are listed, in variable length
  67. records.
  68.  
  69. I. Source names subsection (/S turns display on)
  70.  
  71. This section lists the source files, and .OBJ files that were linked
  72. into this unit.
  73.  
  74. J. Line lengths subsection (/M turns display on)
  75.  
  76. If debugging is turned on, the records here give the correspondence
  77. between source code lines and bytes in the code blocks.
  78.  
  79. II. CODE SECTION (/B turns display on)
  80.  
  81. This section contains the compiled object code, in the order listed in
  82. the code block subsection above.  I don't know if there is any
  83. separation between blocks.
  84.  
  85. III. CONST SECTION (/G turns display on)
  86.  
  87. The initialized data, in the order of the const blocks.
  88.  
  89. IV. CODE RELOCATION RECORDS (/R turns display on)
  90.  
  91. A big array of fixed length records, giving the relocation fixups for
  92. the code blocks.
  93.  
  94. V.  CONST RELOCATION RECORDS (/O turns display on)
  95.  
  96. An array in the same format as IV, giving the relocation fixups for the
  97. const blocks.  Used for fixups for the VMT tables of objects, and
  98. initialized pointer constants.
  99.